//补卡js---------------------------------------------------------------------------------------
//获取要补卡信息的回掉函数
function getReissueCardInfo(json) {
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content = "";
		$(json).each(function(n, item) {
			var numPerPage = item.numPerPage;
			var currentPage = item.currentPage;
			var totalCount = item.totalCount;
			var pageCount = item.pageCount
			var list = item.list;
			// alert(numPerPage+","+currentPage+","+totalCount);
			if (list.length == 0) {
				content += "<tr><td colspan='7' align='center' >未查询到数据</td></tr>"
			} else {
				for (var i = 0; i < list.length; i++) {
					var value = list[i].oldCitizenCardNo + ","
							+ list[i].cardPName + ","
							+ list[i].paperTypeName + ","
							+ list[i].paperNo;
					content += "<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td ><input name='reissueCard' onclick='test(this)' value="
							+ value
							+ " type='radio'></td><td>"
							+ list[i].oldCitizenCardNo
							+ "</td><td>"
							+ list[i].cardPName
							+ "</td><td>"
							+ list[i].cardTypeName
							+ "</td><td>"
							+ list[i].customerName
							+ "</td><td>"
							+ list[i].paperTypeName
							+ "</td><td>"
							+ list[i].paperNo
							+ "</td><td>"
							+ list[i].lossCertNo
							+ "</td><td>"
							+ list[i].cardStatusName
							+ "</td></tr>"
				}

			}
			$("#reissueCard").html(content);
			$("input[name='numPerPage']").val(numPerPage);
			$("input[name='pageNum']").val(currentPage);
			// $("input[name='pageCount']").val(pageCount);
			$("#totalCountByReissueCard").text(
					"条，共" + totalCount + "条");
			// var pagination="<a href='#'
			// onclick="+"previous($('#getReissueCardInfo'),getReissueCardInfo)
			// id='previous' >上一页 </a><a href='#'
			// onclick="+"next($('#getReissueCardInfo'),getReissueCardInfo)
			// id='next'>
			// 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
			// $("#paginationByReissueCard").html(pagination);
			$("#paginationByReissueCard").addClass("pagination")
					.attr("targetType", "navTab").attr(
							"totalCount", totalCount).attr(
							"numPerPage", numPerPage).attr(
							"pageNumShown", "10").attr(
							"currentPage", currentPage).attr("rel",
							"reissueCard").attr("callback",
							"getReissueCardInfo");
			$("div.pagination").each(function() {
				var $this = $(this);
				$this.pagination({
					targetType : "navTab",
					rel : "reissueCard",
					totalCount : totalCount,
					numPerPage : numPerPage,
					pageNumShown : 10,
					currentPage : currentPage,
					callback : getReissueCardInfo
				});
			});
		});
		var $p = $("#ByReissueCard");
		initUI($p);
	}
	
};

// 验证checkBox,处理逻辑，并跳转登记页面
function validateChechBox4() {
	if ($("input[name='reissueCard']:checked").length < 1) {
		alertMsg.warn("您未选择数据！")
		return false;
	}
	if ($("input[name='reissueCard']:checked").length > 1) {
		alertMsg.warn("不能多于一条数据！")
		return false;
	}
	/*
	 * //获取复选框的值 var parm="";
	 * $("input[name='reissueCard']:checked").each(function(n,item){
	 * parm=$(this).val(); })
	 * $.post("reissueCard/goReissueRegister",{parm:parm});
	 * navTab.reload("reissueCard/reissueRegister",""); return false;
	 */

}

// ----换卡js------------------------------------------------------------------------

// 获取要换卡的回掉函数
function getExchangeCardInfo(json) {
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content = "";
		$(json).each(function(n, item) {
			var numPerPage = item.numPerPage;
			var currentPage = item.currentPage;
			var totalCount = item.totalCount;
			var pageCount = item.pageCount
			var list = item.list;
			if (list.length == 0) {
				content += "<tr><td colspan='7' align='center' >未查询到数据</td></tr>"
			} else {
				for (var i = 0; i < list.length; i++) {
					var value = list[i].citizenCardNo + ","+ list[i].cardPName + ","+ list[i].cardTypeName + ","+ list[i].paperTypeName + ","+ list[i].paperNo;
					content += "<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td ><input name='exchangeCard' onclick='test(this)' value="
							+ value
							+ " type='radio'></td><td >"+ list[i].citizenCardNo
							+ "</td><td>"+ list[i].cardPName
							+ "</td><td>"+ list[i].cardTypeName
							+ "</td><td>"+ list[i].customerName
							+ "</td><td>"+ list[i].paperTypeName
							+ "</td><td>"+ list[i].paperNo
							+ "</td><td>"+ list[i].cardStatusName + "</td></tr>"
				}

			}
			$("#exchangeCard").html(content);
			$("input[name='numPerPage']").val(numPerPage);
			$("input[name='pageNum']").val(currentPage);
			// $("input[name='pageCount']").val(pageCount);
			$("#totalCountByExchangeCard").text(
					"条，共" + totalCount + "条");
			// var pagination="<a href='#'
			// onclick="+"previous($('#getExchangeCardInfo'),getExchangeCardInfo)
			// id='previous' >上一页 </a><a href='#'
			// onclick="+"next($('#getExchangeCardInfo'),getExchangeCardInfo)
			// id='next'>
			// 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
			// $("#paginationByExchangeCard").html(pagination);
			$("#paginationByExchangeCard").addClass("pagination")
					.attr("targetType", "navTab").attr(
							"totalCount", totalCount).attr(
							"numPerPage", numPerPage).attr(
							"pageNumShown", "10").attr(
							"currentPage", currentPage).attr("rel",
							"exchangeCard").attr("callback",
							"getExchangeCardInfo");
			$("div.pagination").each(function() {
				var $this = $(this);
				$this.pagination({
					targetType : "navTab",
					rel : "exchangeCard",
					totalCount : totalCount,
					numPerPage : numPerPage,
					pageNumShown : 10,
					currentPage : currentPage,
					callback : getExchangeCardInfo
				});
			});
		});
		var $p = $("#ByExchangeCard");
		initUI($p);
	}
	
}

// 验证checkBox
function validateChechBox5() {
	if ($("input[name='exchangeCard']:checked").length < 1) {
		alertMsg.warn("您未选择数据！")
		return false;
	}
	if ($("input[name='exchangeCard']:checked").length > 1) {
		alertMsg.warn("不能多于一条数据！")
		return false;
	}

}